]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Add Main.notify() for simple system messages
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 28 Jul 2011 18:06:24 +0000 (20:06 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 3 Aug 2011 15:19:18 +0000 (17:19 +0200)
... similar to Main.notifyError(), but don't duplicate the message
on stderr/in the log.

https://bugzilla.gnome.org/show_bug.cgi?id=652718

js/ui/main.js

index 195d3cbbef0d9daa6c9660ba5b9f156487779130..5cde5410d50d75671fb9b677c676c22d992c31e4 100644 (file)
@@ -420,6 +420,19 @@ function loadTheme() {
     themeContext.set_theme (theme);
 }
 
+/**
+ * notify:
+ * @msg: A message
+ * @details: Additional information
+ */
+function notify(msg, details) {
+    let source = new MessageTray.SystemNotificationSource();
+    messageTray.add(source);
+    let notification = new MessageTray.Notification(source, msg, details);
+    notification.setTransient(true);
+    source.notify(notification);
+}
+
 /**
  * notifyError:
  * @msg: An error message
@@ -434,11 +447,7 @@ function notifyError(msg, details) {
     else
         log("error: " + msg)
 
-    let source = new MessageTray.SystemNotificationSource();
-    messageTray.add(source);
-    let notification = new MessageTray.Notification(source, msg, details);
-    notification.setTransient(true);
-    source.notify(notification);
+    notify(msg, details);
 }
 
 /**